package com.boolib.http.core.face.handler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;

/**
 * @author wfq
 */
public interface RequestHandler  extends Handler{

    /**
     * 请求处理器
     * @param httpServletRequest
     * @param httpServletResponse
     */
    void handler(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);


    /**
     * 请求处理器
     * @param httpServletRequest
     */
    void requestHandler(HttpServletRequest httpServletRequest );

    /**
     * 请求处理器
     * @param httpServletRequest
     */
    void responseHandler(HttpServletRequest httpServletRequest );


    /**
     * 传递到下一个handler
     * @param httpServletRequest
     * @param httpServletResponse
     * @return
     */
    void fireHandler(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse);


    /**
     * 获取下一个
     * @return
     */
    RequestHandler next();


    /**
     * 设置下一个requestHandler
     * @param requestHandler
     */
    void setNextRequestHandler(RequestHandler requestHandler);

    /**
     * 是否进行包装
     * @return
     */
    boolean isWrapper();

    boolean isRequest();

    /**
     * 获取包装类型
     * @return
     */
    HttpServletRequest getHttpServletRequestWrapper();
    HttpServletResponse getHttpServletResponseWrapper();


}
